home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / c-lang / vbcc.lha / vbcc / machine.h < prev    next >
C/C++ Source or Header  |  1996-05-15  |  4KB  |  139 lines

  1. /*  $VER: vbcc (machine.h amiga68k) V0.3    */
  2.  
  3. /* Typen des Zielrechners auf dem Rechner des Compilers */
  4.  
  5. typedef signed char zchar;
  6. typedef unsigned char zuchar;
  7. typedef signed short zshort;
  8. typedef unsigned short zushort;
  9. typedef signed int zint;
  10. typedef unsigned int zuint;
  11. typedef signed long zlong;
  12. typedef unsigned long zulong;
  13. typedef float zfloat;
  14. typedef double zdouble;
  15. typedef void *zpointer;
  16.  
  17.  
  18. /* maschinenabhaengige Routinen fuer Typkonversion auf Datentypen   */
  19. /* des Zielcodes                                                    */
  20. #define zc2zl(x) ((zlong)(x))
  21. #define zs2zl(x) ((zlong)(x))
  22. #define zi2zl(x) ((zlong)(x))
  23. #define zl2zc(x) ((zchar)(x))
  24. #define zl2zs(x) ((zshort)(x))
  25. #define zl2zi(x) ((zint)(x))
  26. #define zl2zul(x) ((zulong)(x))
  27. #define zuc2zul(x) ((zulong)(x))
  28. #define zus2zul(x) ((zulong)(x))
  29. #define zui2zul(x) ((zulong)(x))
  30. #define zul2zuc(x) ((zuchar)(x))
  31. #define zul2zus(x) ((zushort)(x))
  32. #define zul2zui(x) ((zuint)(x))
  33. #define zul2zl(x) ((zlong)(x))
  34. #define zf2zd(x) ((zdouble)(x))
  35. #define zd2zf(x) ((zfloat)(x))
  36. #define zl2zd(x) ((zdouble)(x))
  37. #define zd2zl(x) ((zlong)(x))
  38. #define zul2zd(x) ((zdouble)(x))
  39. #define zd2zul(x) ((zulong)(x))
  40. #define zul2zp(x) ((zpointer)(x))
  41. #define zp2zul(x) ((zulong)(x))
  42.  
  43. /* maschinenabhaengige Routinen, um Typen des Compiler in Typen des */
  44. /* Zielcodes zu konvertieren                                        */
  45. #define l2zl(x) ((zlong)(x))
  46. #define zl2l(x) ((long)(x))
  47. #define ul2zul(x) ((zulong)(x))
  48. #define zul2ul(x) ((unsigned long)(x))
  49. #define d2zd(x) ((zdouble)(x))
  50. #define zd2d(x) ((double)(x))
  51.  
  52. /* maschinenabhaengige Rechenroutinen fuer Datentypen des           */
  53. /* Zielcodes                                                        */
  54. #define zlmult(a,b) ((a)*(b))
  55. #define zulmult(a,b) ((a)*(b))
  56. #define zdmult(a,b) ((a)*(b))
  57. #define zldiv(a,b) ((a)/(b))
  58. #define zuldiv(a,b) ((a)/(b))
  59. #define zddiv(a,b) ((a)/(b))
  60. #define zlmod(a,b) ((a)%(b))
  61. #define zulmod(a,b) ((a)%(b))
  62. #define zllshift(a,b) ((a)<<(b))
  63. #define zullshift(a,b) ((a)<<(b))
  64. #define zlrshift(a,b) ((a)>>(b))
  65. #define zulrshift(a,b) ((a)>>(b))
  66. #define zladd(a,b) ((a)+(b))
  67. #define zuladd(a,b) ((a)+(b))
  68. #define zdadd(a,b) ((a)+(b))
  69. #define zlsub(a,b) ((a)-(b))
  70. #define zulsub(a,b) ((a)-(b))
  71. #define zdsub(a,b) ((a)-(b))
  72. #define zpleq(a,b) ((a)<=(b))
  73. #define zlleq(a,b) ((a)<=(b))
  74. #define zulleq(a,b) ((a)<=(b))
  75. #define zdleq(a,b) ((a)<=(b))
  76. #define zleq(a)    ((a)==0)
  77. #define zuleq(a)    ((a)==0)
  78. #define zdeq(a)    ((a)==0)
  79. #define zdeqto(a,b)    ((a)==(b))
  80. #define zleqto(a,b) ((a)==(b))
  81. #define zuleqto(a,b) ((a)==(b))
  82. #define zpeqto(a,b) ((a)==(b))
  83. #define zpeq(a)     ((a)==0)
  84. #define zlor(a,b)   ((a)|(b))
  85. #define zulor(a,b)   ((a)|(b))
  86. #define zland(a,b)   ((a)&(b))
  87. #define zuland(a,b)   ((a)&(b))
  88. #define zlxor(a,b)   ((a)^(b))
  89. #define zulxor(a,b)   ((a)^(b))
  90. #define zlkompl(a)  (~(a))
  91. #define zulkompl(a)  (~(a))
  92. #define zdkompl(a)  (~(a))
  93. #define zlneg(a)    (-(a))
  94. #define zulneg(a)    (-(a))
  95. #define zdneg(a)    (-(a))
  96.  
  97. /*  Struktur fuer erweiterte Adressierungsarten */
  98. struct AddressingMode{
  99.     int basereg;
  100.     long dist;
  101.     int skal;
  102.     int dreg;
  103. };
  104.  
  105. /*  Anzahl der Register     */
  106. #define MAXR 24
  107.  
  108. /*  Anzahl der Optionsflags fuer den Codegenerator  */
  109. #define MAXGF 20
  110.  
  111. /*  Soll der Compiler ICs mit z=q2 erzeugen?    */
  112. #define USEQ2ASZ 0
  113.  
  114. /*  Welcher Typ wird mindestens fuer ADDI2P etc. benoetigt  */
  115. #define MINADDI2P 2     /*  short   */
  116.  
  117. /*  Steht das hoechstwertige Byte eines Integers an erster Stelle?  */
  118. /*  Wenn nicht, wird z.Z. angenommen, dass es genau umgedreht ist.  */
  119. /*  Eine andere Darstellung wird Probleme bei Funktionsparametern   */
  120. /*  machen.                                                         */
  121. #define BIGENDIAN 1
  122.  
  123. /*  Sollen switch-statements als Folge von SUB/TEST statt COMPARE   */
  124. /*  erzeugt werden?                                                 */
  125. #define SWITCHSUBS 1
  126.  
  127. /*  bis zu welcher Groesse sollen memcpy/strcpy-Aufrufe durch       */
  128. /*  ASSIGN-ICs implementiert werden?                                */
  129. #define INLINEMEMCPY (1<<30)
  130.  
  131. #ifndef EXIT_FAILURE
  132. #define EXIT_FAILURE 20
  133. #endif
  134.  
  135. #ifndef EXIT_SUCCESS
  136. #define EXIT_SUCCESS 0
  137. #endif
  138.  
  139.